package com.fuego.creditsystemcommodity.controller;


import com.fuego.creditsystemcommodity.service.IActivityOrderService;
import jakarta.annotation.Resource;
import org.example.dto.Result;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;


@RestController
@RequestMapping("/activity-order")
public class ActivityOrderController {
    @Resource
    private IActivityOrderService activityOrderService;
    @PostMapping("activityInfo/{id}")
    public Result activityInfo(@PathVariable("id") Long activityId, @RequestParam("userId") Long userId,@RequestParam("activityStartTime") LocalDateTime activityStartTime) {
        return activityOrderService.activityInfo(activityId,userId,activityStartTime);
    }

    @GetMapping("/list/allOrder")
    public Result queryAllOrder(@RequestParam("userId") Long userId) {
        return activityOrderService.queryAllOrders(userId);
    }

    @PostMapping("/refund")
    public Result refund(@RequestParam("orderId") Long orderId) {

        return activityOrderService.refund(orderId);
    }
}


